<?php

namespace app\api\controller;

use app\common\controller\Api;
use Intervention\Image\ImageManagerStatic as Image;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        Image::configure(array('driver' => 'imagick'));
        $path = ROOT_PATH .  'public' . DS . 'uploads' . DS . 'images' . DS;
        $image = Image::make($path . 'top.png');
        $image->save($path . 'top.webp', 80);
        $this->success('请求成功');
    }
}
